package com.example.fx.db

import android.content.Context
import androidx.room.Room

class AppDbUtils {
    companion object{
        private lateinit var appDb: AppDb
        //初始化数据库方法
        fun init(context: Context){
            appDb = Room.databaseBuilder(context,AppDb::class.java,"fx.db")
                .allowMainThreadQueries()
                .build()
        }
        //对外暴露数据库
        fun getDb() = appDb
    }
}